package com.lxb.store.dao;

import com.lxb.store.entity.User;
import org.springframework.data.jpa.repository.JpaRepository;
import org.springframework.data.jpa.repository.Query;
import org.springframework.data.repository.CrudRepository;

public interface UserDao extends JpaRepository<User,Integer>,CrudRepository<User,Integer>{

    User getById(Integer id);
    User getByUsername(String username);

    @Query(nativeQuery = true,value = "SELECT shop_car_id FROM user WHERE  username = ?1")
    Integer getShopIdByUsername(String username);

}
